<template>
	<view class="p30">
		<view class="flex mb30" @click="$jump('info',$params)">
			<view class="flex w-max flex1">
				<view class="">
					<u-avatar size="124" :src="data.avatar_path || ''" />
				</view>
				<view class="pl24 flex1">
					<view class="fw-w fs30">{{ data.name || "" }}</view>
					<view class="color-999">创建时间：{{data.create_time}}</view>
				</view>
			</view>
			<u-icon name="arrow-right"></u-icon>
		</view>

		<view class=" radius12  w-max flex mb20 tc">
			<view class=" flex1 " @click="$jump('/pages/my/team/userList',$params)">
				<view class="color-666">团队总人数</view>
				<view class="fw-w mt20 fs40">{{data.master_num||0}}</view>
			</view>
			<view class=" flex1 " @click="$jump('/pages/my/team/userList',$params)">
				<view class="color-666">当前在线人数</view>
				<view class="fw-w mt20 fs40">{{data.online_num||0}}</view>
			</view>
			<view class=" flex1 ">
				<view class="color-666">服务总数</view>
				<view class="fw-w mt20 fs40">{{data.service_num||0}}</view>
			</view>
		</view>
		<view class="radius20 ov-h mb20">
			<u-tabs :list="tabs" :current="current" @change="current=$event" :activeColor="$zs" />
		</view>
		<orderList :list="list"></orderList>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: '',
				current: 0,
				tabs: [{ //	manage=管理的团队，join=加入的团队
						name: '转单待处理',
						id: 'trade',
					},
					{
						name: '历史团队订单',
						id: 'history'
					}
				],
				list: [],
				page: 1,
			};
		},
		computed: {
			type() { //anage=管理的团队，join=加入的团队
				return this.tabs[this.current].id
			}
		},
		watch: {
			type() {
				this.getList()
			}
		},
		onLoad() {},
		onShow() {
			this.getData()
			this.getList()
		},
		onReachBottom() {
			this.getList('down')
		},
		methods: {
			getData() {
				this.$request('/master/agency/agencyInfo', this.$params).then(res => {
					this.data = res.data
				})
			},
			getList(e) {
				e == 'down' ? this.page++ : this.page = 1
				let params = {
					...this.$params,
					page: this.page,
					type: this.type
				}
				this.$request('/master/agency/agencyOrder', params).then(res => {
					let list = res.data.data
					e == 'down' ? this.list.push(...list) : this.list = list
				})
			},
		}
	}
</script>

<style lang="scss">

</style>